package com.ververica.cdc.guass.sink.jdbc.derby.database;

import com.ververica.cdc.guass.sink.jdbc.core.database.JdbcFactory;
import com.ververica.cdc.guass.sink.jdbc.core.database.catalog.JdbcCatalog;
import com.ververica.cdc.guass.sink.jdbc.core.database.dialect.JdbcDialect;
import com.ververica.cdc.guass.sink.jdbc.derby.database.dialect.DerbyDialect;
import org.apache.flink.annotation.Internal;


/** Factory for {@link DerbyDialect}. */
@Internal
public class DerbyFactory implements JdbcFactory {
    @Override
    public boolean acceptsURL(String url) {
        return url.startsWith("jdbc:derby:");
    }

    @Override
    public JdbcDialect createDialect() {
        return new DerbyDialect();
    }

    @Override
    public JdbcCatalog createCatalog(
            ClassLoader classLoader,
            String catalogName,
            String defaultDatabase,
            String username,
            String pwd,
            String baseUrl) {
        throw new UnsupportedOperationException("Catalog for Derby is not supported yet.");
    }
}
